// 导入请求对象
import request from '@/utils/request.js';

// 封装请求函数
export const loginAPI = (data) => {
	return request({
		url: '/v1_0/authorizations',
		method: 'post',
		data,
	});
};

// 请求个人资料
export const userInfoAPI = () => {
	return request({
		url: '/v1_0/user/profile',
	});
};

// 编辑个人资料
export const editUserInfoAPI = (data) => {
	return request({
		url: '/v1_0/user/profile',
		method: 'patch',
		data,
	});
};

// 编辑照片
export const editAvatarAPI = (data) => {
	return request({
		url: '/v1_0/user/photo',
		method: 'patch',
		data,
	});
};
